<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>应用管理</title> {{>/WEB-INF/pages/common/meta_base.part.html}}
{{>/WEB-INF/pages/common/refs_base.part.html}}
</head>
<body>
	{{>/WEB-INF/pages/common/layout_header.part.html}}
	<div class="container">
		<ul class="breadcrumb">
			<li><a href="{{ctx}}">首页</a></li>
			<li class="active">应用管理</li>
		</ul>
		<hr class="hr1" />
		<div class="text-right pad-st-b5">
			<a class="btn btn-primary btn-small tls" href="javascript:addview()">新增应用</a>
		</div>
		<div class="container bg-st-white">
			{{#list}}
			<div class="bg-bl he35px mar-st-b10">
				<strong style="color: #FFFFFF" class="mar-st-l10">{{name}}</strong>
			</div>
			<div class="row">
				{{#appMainlist}}
				<div class="col-sm-6 col-lg-4 mar-st-b10">
					<div class="bor-tab">
						<div class="tit2-st he35px">
							<span class="pull-right mar-st-r10"> {{#appVersionlist}} <a
								href="{{ctx}}/mam/apps/download/{{identifier}}/{{platformid}}?appKey={{appKey}}"><img
									style="cursor: pointer; float: left; margin: 10px 8px 0 0; width: 18px; height: 18px"
									data-toggle="tooltip" title="{{platformid}}下载"
									src="{{ctx}}/static/bsl/images/icon-w-{{platformid}}.png"
									id="icon-w-{{platformid}}" /> </a> {{/appVersionlist}}
							</span>
						</div>
						<div class="pad-st-b10" style="height: 140px;">
							<div class="container">
								<div class="col-sm-4 col-xs-5 text-center mar-st-tb10 bor-ri">
									<img id="appIcon{{id}}" class="img-rounded info-icon"
										style="width: 83px; height: 83px; cursor: pointer"
										onclick="appview('{{id}}')" /> <input type="hidden"
										name="icon" value="{{icon}}" />
								</div>
								<div class="col-sm-8 col-xs-7">
									<h4 class="font-blue">{{app_name}}</h4>
									<small>下载次数：<span class="bg_mun">{{download_counter}}次</span></small>
									<div class="pad-st-t10 img-ma-r10" id="pushCloud_{{id}}">
										{{#cloudList}} <a href="{{ctx}}/{{pageUrl}}"
											data-toggle="tooltip" title="{{name}}"><img
											style="width: 30px; height: 30px" src="{{ctx}}/{{icon}}" /></a>
										{{/cloudList}}
									</div>

								</div>
							</div>
						</div>
					</div>
				</div>
				{{/appMainlist}}
			</div>
			{{/list}}
		</div>
	</div>
	{{>/WEB-INF/pages/common/layout_footer.part.html}}
</body>
</html>
<script type="text/javascript">
	//设置应用图标
	$("div").find(".col-sm-4").each(function(index) {
		var icon = $(this).find('input').val();
		var img = $(this).find('img');
		if (icon != null && icon != "") {
			img.attr("src", "{{ctx}}/mam/attachment/download/" + icon);
		} else {
			img.attr("src", "{{ctx}}/static/bsl/images/defind.png");
		}
	});

	/*//判断是否有版本 上架
	$('div').find(".tit2-st").each(function(index) {
		var version = $(this).find('input');
		if (version != null && version.length > 0) {
			$(this).find(".pull-left").text($(version[0]).val());
		}
	});
	 */
	//设置云服务
	$("div").find(".pad-st-t10").each(function(index) {
		var id = $(this).attr("id");
		var data = id.split('_');
		var appId = data[1];
		$(this).find("a").each(function(index) {
			var href = $(this).attr("href");
			href = href + "?appId=" + appId;
			$(this).attr("href", href);
		});
	});

	function appview(id) {
		window.location.href = "{{ctx}}/mam/appMain/app-view/" + id;
	}

	function addview() {
		window.location.href = "{{ctx}}/mam/appMain/add-view";
	}
	function cloud() {
		window.location.href = "{{ctx}}/system/cloud";
	}

	//点击下载，进行记录下载数量
	function downLoad(versionId) {
		var url = "{{ctx}}/mam/appVersion/count?id=" + versionId;
		window.location.href = url;
	}
</script>
